<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>我的文章</title>
<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
<style>
body{
    background: #F5F7F8;
}
.right-icon{
  position: relative;
}
.right-icon span img{
    width: 1rem;
    height: 1rem;
    display: inline-block;
    margin-top: 0.8rem;
}
/*.aui-badge{
  width: 0.6rem;
  height: 0.6rem;
  line-height: 0.6rem;
  font-size:0.5rem;
  border-radius: 50%;
  background: #E73350 !important;
  left:14%;
}*/
.aui-badge {
    min-width: 0.6rem;
    height: 0.6rem;
    line-height: 0.65rem;
    padding: 0;
    font-size: 0.5rem;
    background-color: #E73350;
    border-radius: 50%;
    top: 0.45rem;
    left: 20%;
}

</style>
</head>

<body>
	<header class="aui-bar aui-bar-nav aui-bar-light" id="header">
        <div class="aui-pull-left back" tapmode onclick="api.closeWin()"></div>
        <div class="aui-title"></div>
        <div class="aui-pull-right right-icon">
            <span class="draft" tapmode onClick="openWin('my_draft_win')" style="padding-right:0.4rem"><img src="../../image/common/26.png" alt=""><div class="aui-badge">0</div></span>
            <!-- <span tapmode onclick="openShare()"><img src="../../image/common/27.png" alt=""></span> -->
        </div>
    </header>
</body>
<script type="text/javascript" src="../../script/import.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
    var USER_ID;
    apiready = function() {
        USER_ID = api.pageParam.itemId;
        console.log(USER_ID)
        api.parseTapmode();
		    var header = $api.byId('header');
        $api.fixStatusBar(header);
        var headerH = $api.offset(header).h;
        if(USER_ID == getUserId() || USER_ID == undefined ){
          $$('.draft').removeClass('aui-hide')
        }else{
          $$('.draft').addClass('aui-hide')
        }
        // 监听获取草稿length数量
        api.addEventListener({
            name: 'mydraftEvent'
        }, function(ret, err){
            if( ret ){
                $$('.aui-badge').text( ret.value.mydraft );
            }
        });
        api.openFrame({
            name: 'article_frm',
            url: 'article_frm.html',
            rect: {
                x: 0,
                y: headerH,
                w: 'auto',
                h: 'auto',
            },
            pageParam: api.pageParam
        });
    };

    function openShare(){
      api.openFrame({
        name:'share_mask',
        url:'../share_mask.html',
        rect:{
          x:'auto',
          y: 'auto',
          w: api.winWidth,
          h: api.winHeight
        },
        bounces: false,
      })
  }

  function openWin(url){
    api.openWin({
        name: url,
        url: url + '.html'
    });
  }
</script>
</html>
